import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name:'login',
      component:()=>import('@/views/loginView.vue')
    },
    {
      path: '/home',
      name: '主页',
      component: () => import('@/views/homeView.vue'),
      children: [
        {
          path: 'platform',
          name: '工作台',
          component: () => import('@/views/platformView.vue')
        },{
          path: 'data',
          name: '数据统计',
          component: () => import('@/views/dataView.vue')
        },{
          path: 'sort',
          name: '分类管理',
          component: () => import('@/views/sortView.vue')
        },
        {
          path: 'dishes',
          name: '菜品管理',
          component: () => import('@/views/dishesView.vue')
        },
        {
          path: 'order',
          name: '订单管理',
          component: () => import('@/views/orderView.vue')
        },
        {
          path: 'staff',
          name: '员工管理',
          component: () => import('@/views/staffView.vue')
        }
      ]
    }
  ]
})

export default router
